<template>
	<view class="content">

		<view class="content-item" v-for="(item, index) in clothingData" :key="index">

			<view class="content-item-icon">
				<image :src="imgBaseUrl + item.mimgUrl"></image>
			</view>
			<view class="content-item-title">
				<view class="content-item-list-title3">{{item.mimgDescribe}}</view>
			</view>

		</view>

	</view>
</template>

<script>
	//提升this的作用域
	let _self
	export default {
		data() {
			return {
				userId: '',
				clothingData: '',
				imgBaseUrl: ''
			}
		},
		onLoad(option) {
			_self = this
			_self.userId = option.id
			_self.getHistoryData()
			_self.imgBaseUrl = _self.$api.IMG_SERVER_BASE
		},
		methods: {
			getHistoryData() {
				_self.$post(_self.$api.POST_PAGINATION_QUERY_USER_IMG, {
					current: 1,
					id: _self.userId,
					size: 5
				}).then(res => {
					if (res.code == 200) {
						_self.clothingData = res.content.records
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.content {
		display: flex;
		flex-direction: column;

		.content-item {
			display: flex;
			margin: 30rpx;

			.content-item-icon {
				width: 270rpx;
				height: 480rpx;
				margin-right: 20rpx;
				border-radius: 20rpx;

				image {
					width: 100%;
					height: 100%;
					border-radius: 20rpx;
				}
			}

			.content-item-title {
				display: flex;
				flex-direction: column;
				justify-content: space-around;
				padding: 30rpx 0;

				.content-item-list-title1 {
					font-weight: bold;
					font-size: 36rpx;
					color: black;
					margin-bottom: 10rpx;
				}

				.content-item-list-title2 {
					color: black;
					font-size: 30rpx;
					margin-bottom: 10rpx;

					span {
						margin-right: 10rpx;
					}
				}

				.content-item-list-title3 {
					color: black;
					font-size: 26rpx;
				}
			}
		}
	}
</style>
